Working of a Payment System

Understand the working of the payment ecosystem and the role of the payment gateway within it.

In today's era, fintech advancement has paved the way for digital marketing and e-commerce businesses. It has brought together and enhanced the trust between merchants and customers, where the customer buys goods and pays the merchants in just a few clicks. Contemporary entities in the payment processing cycle are radically changing the customer experience and making it possible for merchants to run their operations with a great deal of simplicity, unlike in the past when it was just about facilitating the transfer of funds.

In this lesson, we will describe the digital payment system and explain how a payment gateway has made the payment process easier in the modern world.

The payment process#

Online payment takes a few seconds. A customer simply has to enter their credit card details to pay online for the goods or services they want to buy. However, this is a very complex process that entails multiple steps and interacting entities—for example, cardholder verification, payment processing and validation, merchants registration, and so on.

The following figure illustrates the flow of a payment processing system:

Payment processing system and the organizations involved in it
Payment processing system and the organizations involved in it

The role of entities involved in the payment processing system is mentioned in the following table:

Entities Details

Entities

Description

Customer

  • A card holder who wants to purchase goods or service

Merchant

  • A company or person who provides goods or services

Issuer bank

  • The bank that holds the customer’s account and provides credit or debit cards

Acquiring bank

  • The bank holding the merchant's account

Merchant's online store

  • The online website where the customer purchases goods or services by providing credit card details


Stripe

  • A network that facilitates and authorizes transactions of funds to merchants’ account
  • Requests and receives payment from the customer’s account


Cards network

  • Validates the credit or debit card information
  • Facilitates payments via credit and debit cards
  • Sets the terms for credit or debit card transactions

Note: Sometimes, another entity that sets between the issuer bank and cards network is involved, known as the issuer processor. The issuer processor facilitates the authorization, clearing, and settlement of a payment transaction on behalf of the issuing bank. However, many issuer banks have their own (in-house) issuer processors to have more control over the entire process, which often results in cost savings.

A payment gateway facilitates the secure handling and processing of online transactions between merchants and customers. It acts as an intermediary between the two, authorizing and settling payments through different methods such as bank transfers, digital wallets, and credit and debit cards.

A payment gateway like Stripe enables businesses of all sizes to process payments online without worrying about fraudulent activities, security compliance, verification of cardholder information, and streamlining payment processes to enhance customer experience and the reliability of transactions.

Point to Ponder

Question

Why are multiple entities involved in the payment ecosystem?

Hide Answer

Multiple entities are involved in the payment ecosystem because each entity has a different and unique role. For example, the issuer bank issues credit cards, the merchant is responsible for providing goods or services, and the payment gateway is responsible for securely transferring funds. Each entity is necessary for the payment process to be successful.

Let's take a closer look and explain the overall process of transferring funds that takes place behind the scenes.

The flow of payment processing takes place in the following steps:

  1. The authorization phase

  2. The settlement phase

The authorization phase#

Initially, we assume that the customer has an account in the issuer bank and the merchant has an account in the acquirer bank. The merchant also has a virtual account with Stripe, where all the transactions are stored in its databases. Now let’s discuss the steps involved in the authorization process:

  1. The customers select the goods or services they want to purchase online, go to the checkout page, and enter their credit card information. Here, a transaction is created, including information about the customer, their credit card, the goods or services purchased, and so on.

  2. The transaction information is provided to Stripe for further processing. Stripe stores the transaction details to facilitate funds transfer in the later phase.

  3. Stripe routes the credit/debit card details and transaction information to the cards network.

  4. The cards network performs the credit card’s authentication and passes the transaction information to the issuer bank to check the validity of the customer’s account information.

  5. The issuer bank checks the status of the customer’s account and the availability of funds. Upon confirmation of their availability, it places a hold on the required funds.

  6. The issuer bank responds with a successful authorization code to the cards network, which is passed to Stripe.

  7. Stripe sends the authorization code to the acquiring bank.

  8. The acquiring bank provides the approval to the merchant’s terminal, which in turn may provide the receipt to the customer.

  9. Meanwhile, Stripe updates the transaction information in its database based on the authorization codes provided by the issuer bank via cards network.

Points to Ponder

Question 2

How does the cards network verify the data from the issuer bank if the credit card data from Stripe is in the form of a token?

Hide Answer

The cards network uses the token provided by Stripe to request the original credit card data from Stripe’s servers via a secure connection. Since Stripe securely stores the original credit card data on its server, it verifies the token and returns the corresponding credit card data to the cards network upon request. Note that credit card data is encrypted during the transmission.

2 of 2

The authorization phase is explained in the following set of illustrations:

Created with Fabric.js 3.6.6
The customer selects the items they want to purchase and enters their credit card information

1 of 9

Created with Fabric.js 3.6.6
The transaction and cards information is provided to the payment gateway

2 of 9

Created with Fabric.js 3.6.6
The payment gateway encrypts the card details and routes them to the cards network

3 of 9

Created with Fabric.js 3.6.6
The cards network passes the information to the issuer bank to check the validity of customer's account

4 of 9

Created with Fabric.js 3.6.6
The issuer bank checks the status of the customer's account and places a hold on the required funds

5 of 9

Created with Fabric.js 3.6.6
The issuer bank responds with a successful authorization code to the cards network, which is passed to Stripe

6 of 9

Created with Fabric.js 3.6.6
Stripe sends the authorization code to the acquiring bank

7 of 9

Created with Fabric.js 3.6.6
The acquiring bank provides approval to the merchant's terminal

8 of 9

Created with Fabric.js 3.6.6
The payment gateway updates the transaction information in its database

9 of 9

Note: Every organization that processes, stores, or transfers credit card information should be PCI compliant. According to the PCI Security Standards Council, such organizations should use the secure file transfer protocol (STFP) to transmit sensitive data.

The settlement phase#

In the authorization phase, the credit or debit card information is validated. Moreover, the customer’s account is checked for the available amount, and the funds for the purchase are locked. In the settlement phase, the amount of all the successful transactions is transferred to the merchant’s account in the acquirer’s bank or to the virtual account in Stripe. This phase involves the following steps:

  1. At the end of the day, Stripe collects all the transactions and corresponding authorization codes from the database and transfers them to the acquiring bank. The purpose is to withdraw the respective amount from the issuer’s bank.

  2. The acquiring bank sends all data to the cards network to validate each transaction and its corresponding authorization codes.

  3. The cards network routes all transaction information to the issuer bank for verification.

  4. The issuer bank transfers the funds to the merchant account in Stripe after successful verification. The verification is performed against each authorization code provided in the authorization phase.

  5. The issuer bank provides a bill to the customer or the cardholder for every successful transaction.

  6. The merchant can later transfer the funds from the Stripe account to their bank account in the acquiring bank.

The activities mentioned above can take a few days to process for different reasons, such as ensuring fraud prevention, running bank processes, resolving disputes (if any), and so on. The flow of the settlement phase is depicted in the following illustration:

Created with Fabric.js 3.6.6
Stripe sends all the transaction information and their corresponding authorization codes to the acquiring bank

1 of 6

Created with Fabric.js 3.6.6
The acquiring bank sends the transaction information to the cards network for settlement

2 of 6

Created with Fabric.js 3.6.6
The cards network routes all the information to the issuer bank

3 of 6

Created with Fabric.js 3.6.6
The issuer bank transfers the required funds to the merchant account in Stripe

4 of 6

Created with Fabric.js 3.6.6
The issuer bank provides the bill to the customer

5 of 6

Created with Fabric.js 3.6.6
The merchant can later transfer the funds to their bank account in the acquiring bank

6 of 6

Note: In reality, the transfer of funds go through two separate entities:

  • The payment gateway: A payment gateway requests and receives payment from the customer’s account.

  • The payment processor: A payment processor facilitates the transfer of funds between a merchant and a customer's bank account. It is an essential part of the payment ecosystem because it is responsible for securely processing and verifying payments. 

Stripe can provide the functionality of both these systems.

Point to Ponder

Question

Why does the issuer send funds to Stripe and not to the acquiring bank?

Hide Answer

Issuers send funds to Stripe because Stripe acts as a payment processor. It securely transfers funds from the issuer to the merchant’s account. This helps to ensure that the funds are transferred securely and that the merchant receives the correct amount.

In this lesson, we looked at the overall working of the payment system and the importance of the payment gateway (Stripe) within it. Let’s dive deep into Stripe, a well-known payment gateway, and its design API to understand more about its working in the next lesson.

Requirements of the Stripe API

Stripe API Design Decisions